<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var xhr = new XMLHttpRequest()
        xhr.open('POST', 'http://127.0.0.1:3000/json')
        var obj = {
            name: '西游记',
            about: '吴承恩'
        }
        var data = JSON.stringify(obj);
        xhr.setRequestHeader('Content-Type', 'application/json;charset=UTF-8')
        xhr.send(data);
    </script>
</body>

</html>